package com.city.repository.report;/*
 * @Author: 李顺时
 * @Description:
 * @Date: Create in 13:48 2018/9/7
 * @Modified By:
 * */

import com.city.domain.report.CtLegalPerson;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CtLegalPersonRepository extends JpaRepository<CtLegalPerson,Integer> {

    @Query(value = "select * from ct_legal_person where id=?1", nativeQuery = true)
    CtLegalPerson findLegalPersonById(Integer id);

    @Query(value = "select * from ct_legal_person", nativeQuery = true)
    List<CtLegalPerson> findAll();

    @Query(value = "select * from ct_legal_person where company_name=?1",nativeQuery = true)
    CtLegalPerson findAllByCompanyName(String companyname);

    @Query(value = "select * from ct_legal_person where name =?1",nativeQuery = true)
    List<CtLegalPerson> findAllByName(String name);
}
